import News from '@/models/news';
import NewsService from '@/services/news';
import { action, observable } from 'mobx';

/**
 * 局部详情Store
 */
export default class InfoStore {
  @observable
  newsInfo?: News;
  @observable
  newsInfoLoading: boolean = false;

  @action
  async infoNews(id: any) {
    this.newsInfoLoading = true;
    this.newsInfo = (await NewsService.info(id)).dataInfo;
    this.newsInfoLoading = false;
  }
}
